/*free_xen_event_channel(v, v->arch.hvm_vcpu.xen_port);*/
}
-static void hvm_vcpu_down(void)
+void hvm_vcpu_down(struct vcpu *v)
{
- struct vcpu *v = current;
struct domain *d = v->domain;
int online_count = 0;
- gdprintk(XENLOG_INFO, "VCPU%d: going offline.\n", v->vcpu_id);
-
/* Doesn't halt us immediately, but we'll never return to guest context. */
set_bit(_VPF_down, &v->pause_flags);
vcpu_sleep_nosync(v);
/* ... Shut down the domain if not. */
if ( online_count == 0 )
{
- gdprintk(XENLOG_INFO, "all CPUs offline -- powering off.\n");
+ gdprintk(XENLOG_INFO, "All CPUs offline -- powering off.\n");
domain_shutdown(d, SHUTDOWN_poweroff);
}
}
* out of this.
*/
if ( unlikely(!(rflags & X86_EFLAGS_IF)) )
- return hvm_vcpu_down();
+ return hvm_vcpu_down(current);
do_sched_op_compat(SCHEDOP_block, 0);
}
return X86EMUL_OKAY;
/* Asynchronously take the VCPU down and schedule reset work. */
- set_bit(_VPF_down, &v->pause_flags);
- vcpu_sleep_nosync(v);
+ hvm_vcpu_down(v);
tasklet_schedule(&vcpu_vlapic(v)->init_tasklet);
return X86EMUL_RETRY;
}
int hvm_vcpu_initialise(struct vcpu *v);
void hvm_vcpu_destroy(struct vcpu *v);
+void hvm_vcpu_down(struct vcpu *v);
void hvm_send_assist_req(struct vcpu *v);